package course;

import java.util.Date;
import java.util.List;

import people.professor.Professor;
import people.student.Student;
import permission.role.AdministratorRole;
import permission.role.CourseLeaderRole;

/**
 * @author Andreas Waldherr (e1028787@student.tuwien.ac.at)
 *
 */
public abstract class AbstractCourseType extends AbstractCourse{

	private Course course;
	
	public Course getCourse(){
		return this.course;
	}
	
	public void setCourse(Course c){
		this.course = c;	
	}
	
	protected AbstractCourseType(String courseID, String courseName, Professor courseLeader, Date registerStart, Date registerEnd, Date unregisterEnd){
		super(courseID, courseName, courseLeader, registerStart, registerEnd, unregisterEnd);
		
	}
	
	/**
	 * 
	 * @param s
	 * @return
	 */
	public abstract boolean isStudentRegistered(Student s);
	
	/**
	 * Returns Information about the Student (e.g. Groups attending)
	 * @param s
	 * @return
	 */
	public abstract String getInformationForStudent(Student s);
	
	/**
	 * this methods translates a generic integer-value from an evaluation
	 * to a course-specific grade
	 * 
	 * @param value a generic value
	 * @return the type-specific interpretation of the value
	 */
	public abstract String getGrade(int value);
	
	/**
	 * this method is called when a student registers to this type.
	 * it should return a list of options. the first entry is an
	 * explanation-text.
	 * example:
	 * List-Element | Content
	 * 0            | to complete registration, please choose your group:
	 * 1            | Group 1: every Friday
	 * 2            | Group 2: every Wednesday
	 * 3            | No Group
	 * 
	 * The choice then has to be reported back to the course-type via 
	 * the finalizeRegistration-Method. If this method returns null or
	 * a List with only 1 element, you still need to call finalizeRegistration().
	 * 
	 * @param s the student who signed up
	 */
	public abstract List<String> registrationOptions(Student s);
	
	/**
	 * this method processes the selected option from
	 * registrationOptions-Method. 
	 * 
	 * @param index
	 * @return true if the registration was successful, otherwise false
	 */
	public abstract boolean finalizeRegistration(Student s, int index);

}